import time
#nigabol1
with open ("m1_sorted.txt") as f:
    a=f.readlines()
for i in range(len(a)):
    a[i]=int(a[i])
##nigabol2
with open ("m2_reverse.txt") as f:
    b=f.readlines()
for i in range(len(b)):
    b[i]=int(b[i])
##nigabol3
with open ("m3_shuffle.txt") as f:
    c=f.readlines()
for i in range(len(b)):
    b[i]=int(b[i])
def bubble_sort(a):
    z=True
    while z:
        z=False
        for i in range (len(a)-1):
            if a[i] > a[i+1]:
                a[i],a[i+1] = a[i+1],a[i]
                z=True
    return a
st=time.time()
bubble_sort(a)
print("m1_sorted.txt",round((time.time()-st)*1000),"milliseconds")
st=time.time()
bubble_sort(b)
print("m2_reverse.txt",round((time.time()-st)*1000),"milliseconds")
st=time.time()
bubble_sort(c)
print("m3_shuffle.txt",round((time.time()-st)*1000),"milliseconds")
